/*
 *  砝码称重
 *  典型的DP问题，就可以用动态规划去解决
 *  状态转移方程是f(i,j) = f(i-1, j) || f(i-1, j+w[i]) || f(i-1, abs(j-w[i]))
 *  初始状态应该是f(0,0) = 1;
 * */

#include <iostream>
#include <math.h>
#include <vector>
using namespace std;

vector<vector<int>> f(101, vector<int>(100001, 0));
int main() {

    int n;
    cin >> n;
    vector<int> w(n + 1);
    // 这是总重
    int sum = 0;
    for (int i = 1; i <= n; ++i) {
        cin >> w[i];
        sum += w[i];
    }

    // 这是初始条件
    f[0][0] = 1;
    for (int i = 1; i <= n; ++i) {
        for (int j = 0; j <= sum; ++j) {
            f[i][j] = f[i - 1][j] || f[i - 1][j + w[i]] || f[i - 1][abs(j - w[i])];
        }
    }

    int ans = 0;
    for (int i = 1; i <= sum; ++i) {
        if (f[n][i]) {
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}